import request from '@/api/request.js'


const api_name = '/ExcuseURL'

export default {
    //获取当前用户正在申请的请假条
    getApprovingExcuseList(user_id) {
        return request({
            url: `${api_name}/approvingExcuseList/${user_id}`,
            method: 'get'
        })

    },

    //用户请假申请
    addExcuse(excuse) {
        return request({
            url: `${api_name}/addExcuse`,
            method: 'post',
            data: excuse
        })
    },
    //获取本单位请假申请列表
    getApproveExcuseList(excuseDto) {
        return request({
            url: `${api_name}/approveExcuseList`,
            method: 'post',
            data: excuseDto
        })
    },
    //上级审批用户请假请求
    approveExcuse(excuseDto) {
        return request({
            url: `${api_name}/approveExcuse`,
            method: 'post',
            data: excuseDto
        })
    },
    //获取本单位销假申请列表
    getDeletingExcuseList(excuseDto) {
        return request({
            url: `${api_name}/deletingExcuseList`,
            method: 'post',
            data: excuseDto
        })
    },
    //上级批阅用户的销假请求
    superiorDeleteExcuse(excuseDto) {
        return request({
            url: `${api_name}/superiorDeleteExcuse`,
            method: 'post',
            data: excuseDto
        })
    },
    //用于获取当前用户的请假历史
    getApprovedExcuseList(excuseDto) {
        return request({
            url: `${api_name}/approvedExcuseList`,
            method: 'post',
            data: excuseDto
        })
    },
    //用于用户销假
    deleteExcuse(excuseid) {
        return request({
            url: `${api_name}/deleteExcuse/${excuseid}`,
            method: 'get'
        })
    },
    //获取用户
    willDeleteExcuse(excuseDto) {
        return request({
            url: `${api_name}/willDeleteExcuse`,
            method: 'post',
            data: excuseDto
        })
    }
}